From 9b6fdc5d38f582d649661a476e77fac2ff313205 Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Mon, 24 Oct 2005 12:57:37 +0100 Subject: [PATCH] compute the correct totalram_pages when the balloon increase or decrease the reservation. memory reports should be more correct now. From: Satoshi Uchida Signed-off-by: Vincent Hanquez --- linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index 14a9718326..f630d4bf71 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -70,6 +70,9 @@ spinlock_t balloon_lock = SPIN_LOCK_UNLOCKED; static unsigned long current_pages; static unsigned long target_pages; +/* VM /proc information for memory */ +extern unsigned long totalram_pages; + /* We may hit the hard limit in Xen. If we do then we remember it. */ static unsigned long hard_limit; @@ -223,6 +226,7 @@ static int increase_reservation(unsigned long nr_pages) } current_pages += nr_pages; + totalram_pages = current_pages; out: balloon_unlock(flags); @@ -295,6 +299,7 @@ static int decrease_reservation(unsigned long nr_pages) XENMEM_decrease_reservation, &reservation) != nr_pages); current_pages -= nr_pages; + totalram_pages = current_pages; balloon_unlock(flags); -- 2.30.2